package net.hcdz.identity.bean;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;



@Entity @Table(name="InformationPublishing_VIDEO", 
	indexes={@Index(columnList="VIDEO_ID", name="IDX_VIDEO_ID")})
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Video implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="VIDEO_ID")
	private Long videoId;
	
	
	//视频名称
	@Column(name="VIDEO_NAME", length=50)
	private String videoName;
	
	//封面图片路径
	@Column(name="VIDEO_PICURL", length=50)
	private String videoPicUrl;
	
	//上映时间
	@Column(name="VIDEO_RELEASETIME", length=4)
	private String videoReleaseTime;
	
/*	@Column(name="VIDEO_PATH")
	private Integer videoPath;*/
	
	//简介
	@Column(name="VIDEO_SYNOPSIS",length=50)
	private String videoSynopsis;
	
	//时间
	@Column(name="VIDEO_TIME",length=50)
	private String videoTime;
	
	//标题
	@Column(name="VIDEO_TITLE",length=50)
	private String videoTitle;
	
	//大小
/*	@Column(name="VIDEO_SIZE",length=50)
	private String videoSize;*/
	
	//查看次数
	@Column(name="VIDEO_VIEWS",length=50)
	private String videoViews;
	
	//审核状态	
	@Column(name="VIDEO_STATE",length=50)
	private String videoState;
	
	//审核意见
	@Column(name="VIDEO_OPINION",length=50)
	private String videoOpinion;
	
	//创建人ID 
	@ManyToOne(fetch=FetchType.EAGER, targetEntity=User.class)
	@JoinColumn(name="VIDEO_INPUTPERSONNELID", referencedColumnName="USER_ID",
			foreignKey=@ForeignKey(name="videoInputPersonnelId"))
	private User videoInputPersonnelId;
	
	//类别ID
	@ManyToOne(fetch=FetchType.EAGER, targetEntity=Motif.class)
	@JoinColumn(name="VIDEO_CLASSIFIFCATIONID", referencedColumnName="MOTIF_ID",
			foreignKey=@ForeignKey(name="videoClassificationId"))
	private Motif videoClassificationId;
	
	//审核人ID
	@ManyToOne(fetch=FetchType.EAGER, targetEntity=User.class)
	@JoinColumn(name="VIDEO_AUDITPERSONNELID", referencedColumnName="USER_ID",
		foreignKey=@ForeignKey(name="videoAuditPersonnelId"))
	private User videoAuditPersonnelId;
	
	@OneToOne(fetch=FetchType.EAGER,targetEntity=Files.class)
	@JoinColumn(name="VIDEO_FILESID",referencedColumnName="FILES_ID",unique=true)
	private Files videoFilesId;
	
	@Column(name="del_Flag")
	private String delFlag = "1";

	public Long getVideoId() {
		return videoId;
	}

	public void setVideoId(Long videoId) {
		this.videoId = videoId;
	}

	public String getVideoName() {
		return videoName;
	}

	public void setVideoName(String videoName) {
		this.videoName = videoName;
	}

	public String getVideoPicUrl() {
		return videoPicUrl;
	}

	public void setVideoPicUrl(String videoPicUrl) {
		this.videoPicUrl = videoPicUrl;
	}

	public String getVideoReleaseTime() {
		return videoReleaseTime;
	}

	public void setVideoReleaseTime(String videoReleaseTime) {
		this.videoReleaseTime = videoReleaseTime;
	}

	public String getVideoSynopsis() {
		return videoSynopsis;
	}

	public void setVideoSynopsis(String videoSynopsis) {
		this.videoSynopsis = videoSynopsis;
	}

	public String getVideoTime() {
		return videoTime;
	}

	public void setVideoTime(String videoTime) {
		this.videoTime = videoTime;
	}

	public String getVideoTitle() {
		return videoTitle;
	}

	public void setVideoTitle(String videoTitle) {
		this.videoTitle = videoTitle;
	}

	public String getVideoViews() {
		return videoViews;
	}

	public void setVideoViews(String videoViews) {
		this.videoViews = videoViews;
	}

	public String getVideoState() {
		return videoState;
	}

	public void setVideoState(String videoState) {
		this.videoState = videoState;
	}

	public String getVideoOpinion() {
		return videoOpinion;
	}

	public void setVideoOpinion(String videoOpinion) {
		this.videoOpinion = videoOpinion;
	}

	public User getVideoInputPersonnelId() {
		return videoInputPersonnelId;
	}

	public void setVideoInputPersonnelId(User videoInputPersonnelId) {
		this.videoInputPersonnelId = videoInputPersonnelId;
	}

	public Motif getVideoClassificationId() {
		return videoClassificationId;
	}

	public void setVideoClassificationId(Motif videoClassificationId) {
		this.videoClassificationId = videoClassificationId;
	}

	public User getVideoAuditPersonnelId() {
		return videoAuditPersonnelId;
	}

	public void setVideoAuditPersonnelId(User videoAuditPersonnelId) {
		this.videoAuditPersonnelId = videoAuditPersonnelId;
	}

	public Files getVideoFilesId() {
		return videoFilesId;
	}

	public void setVideoFilesId(Files videoFilesId) {
		this.videoFilesId = videoFilesId;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	@Override
	public String toString() {
		return "Video [videoId=" + videoId + ", videoName=" + videoName + ", videoPicUrl=" + videoPicUrl
				+ ", videoReleaseTime=" + videoReleaseTime + ", videoSynopsis=" + videoSynopsis + ", videoTime="
				+ videoTime + ", videoTitle=" + videoTitle + ", videoViews=" + videoViews + ", videoState=" + videoState
				+ ", videoOpinion=" + videoOpinion + ", videoInputPersonnelId=" + videoInputPersonnelId
				+ ", videoClassificationId=" + videoClassificationId + ", videoAuditPersonnelId="
				+ videoAuditPersonnelId + ", videoFilesId=" + videoFilesId + ", delFlag=" + delFlag + "]";
	}
	
	

}
